package com.xique.client.api;

import com.github.lianjiatech.retrofit.spring.boot.annotation.RetrofitClient;
import com.xique.common.core.web.domain.AjaxResult;
import com.xique.common.core.web.page.TableDataInfo;
import retrofit2.http.*;

import java.util.Map;

/**
 * @author shd
 * @create 2021/7/27 10:35
 */
@RetrofitClient(baseUrl = "${command.platformApiUrl}")
public interface IClientApi {

    /**
     * 获取首页数据
     *
     * @param clientId 岗亭ID
     * @return com.xique.common.core.web.domain.AjaxResult
     * @author shd
     * @date 2021/7/27 10:47
     */
    @GET("homePageInfo")
    AjaxResult getHomePageInfo(@Query("clientId") String clientId);

    /**
     * 获取车辆管理类型
     *
     * @param parkId 车场ID
     * @return com.xique.common.core.web.domain.AjaxResult
     * @author shd
     * @date 2021/7/28 17:27
     */
    @GET("parkOn/mngtype")
    AjaxResult getMngTypeInfo(@Query("parkId") Long parkId);

    /**
     * 获取在场记录
     *
     * @param map /
     * @return com.xique.common.core.web.domain.AjaxResult
     * @author shd
     * @date 2021/7/28 17:31
     * @Query("clientId") String clientId, @Query("inTimeBegin") Date inTimeBegin,
     * @Query("inTimeEnd") Date inTimeEnd, @Query("mngTypeId") String mngTypeId,
     * @Query("plate") String plate, @Query("pageNum") Integer pageNum, @Query("pageSize") Integer pageSize
     */
    @POST("parkOn/list")
    TableDataInfo getParkOnList(@Body Map<String, Object> map);

    /**
     * 获取岗亭设备列表
     *
     * @param map /
     * @return com.xique.common.core.web.domain.AjaxResult
     * @author shd
     * @date 2021/7/29 10:25
     * @Query("clientId") String clientId, @Query("pageNum") Integer pageNum, @Query("pageSize") Integer pageSize
     */
    @GET("device/list")
    TableDataInfo getDeviceList(@QueryMap Map<String, Object> map);

    @GET("multCar/list")
    TableDataInfo multCarList(@QueryMap Map<String, Object> map);

    @POST("inOut/list")
    TableDataInfo inOutList(@Body Map<String, Object> map);

    @POST("lane/config/edit")
    AjaxResult editClientLaneConfig(@Body Map<String, Object> map);

    @GET("lane/detail")
    AjaxResult lanDetail(@QueryMap Map<String, Object> map);

    @POST("handCarInOrOut")
    AjaxResult handCarInOrOut(@Body Map<String, Object> map);

    @POST("plate/edit")
    AjaxResult editPlate(@Body Map<String, Object> map);

    @GET("parkOn/getUrl")
    AjaxResult getParkOnUrl(@QueryMap Map<String, Object> map);

    @POST("handOut/info")
    AjaxResult getHandOutInfo(@Body Map<String, Object> map);

    @POST("out/cancelPass")
    AjaxResult cancelPass(@Body Map<String, Object> map);

    /**
     * 车位信息
     *
     * @param parkId 车场ID
     * @return com.xique.common.core.web.domain.AjaxResult
     * @author shd
     * @date 2021/8/9 14:25
     */
    @GET("home/space")
    AjaxResult spaceInfo(@Query("parkId") Long parkId);

    /**
     * 修改剩余车位数
     *
     * @param map /
     * @return com.xique.common.core.web.domain.AjaxResult
     * @author shd
     * @date 2021/8/9 15:01
     */
    @POST("home/space/edit")
    AjaxResult spaceEdit(@Body Map<String, Object> map);

    /**
     * 通道信息
     *
     * @param deviceId 设备ID
     * @return com.xique.common.core.web.domain.AjaxResult
     * @author shd
     * @date 2021/8/10 9:48
     */
    @GET("lane/info")
    AjaxResult laneInfo(@Query("deviceId") Long deviceId);

    /**
     * 现金收费记录
     *
     * @param map /
     * @return /
     */
    @POST("record/cashPass")
    TableDataInfo cashPassList(@Body Map<String, Object> map);

    @GET("parkIn/detail")
    AjaxResult parkInDetail(@Query("inId") Long inId);

    @GET("parkOut/detail")
    AjaxResult parkOutDetail(@Query("outId") Long outId);
}
